$('.order-del').each(function () {
    $(this).off('click').on('click',function () {
        var url = $(this).data('action');
        layer.confirm('确定要删除订单吗?',function () {
            $.get(url,function (response) {
                if(response.status == 1){
                    layer.msg('删除成功');
                    window.location.reload();
                    return true;
                }else{
                    layer.msg(response.msg);
                }
            });
        });
    });
});

$('.order-cancel').each(function () {
    $(this).off('click').on('click',function () {
        var url = $(this).data('action');
        layer.confirm('确定要取消订单吗?',function () {
            $.get(url,function (response) {
                if(response.status == 1){
                    layer.msg('取消成功');
                    window.location.reload();
                    return true;
                }else{
                    layer.msg(response.msg);
                }
            });
        });
    });
});


$('.order-confirm').each(function () {
    $(this).off('click').on('click',function () {
        var url = $(this).data('action');
        layer.confirm('确定要收货订单吗?',function () {
            $.get(url,function (response) {
                if(response.status == 1){
                    layer.msg('收货成功');
                    window.location.reload();
                    return true;
                }else{
                    layer.msg(response.msg);
                }
            });
        });
    });
});
